package com.cap6.config;

import com.cap1.Person;
import com.cap6.bean.Cat;
import com.cap6.bean.Dog;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import(value = {Dog.class, Cat.class,JamesImportSelector.class,JamesImportBeanDefinitionRegistrar.class})
public class Cap6MainConfig {
    /**
     * @Bean
     */
    //容器启动时初始化的Bean
    @Bean("person")
    public Person person() {
        System.out.println("给容器中添加----person----");
        return new Person("james", 20);
    }
    @Bean
    public JamesFactoryBean jamesFactoryBean() {
        System.out.println("给容器中添加----jamesFactoryBean----");
        return new JamesFactoryBean();
    }
}
